-
Notifications
You must be signed in to change notification settings - Fork 373
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ekump/upgrade to rubocop 1.50.0 #3147
Conversation
b67f109
to
9e9ea05
Compare
@@ -160,11 +160,11 @@ def obfuscate_query(query, options = {}) | |||
(?:"|%22) # closing '"' at end of value | |||
) | |||
|(?: # other common secret values | |||
bearer(?:\s|%20)+[a-z0-9._\-]+ | |||
bearer(?:\s|%20)+[a-z0-9._-]+ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The regex changes are just removing redundant escape characters
@@ -255,9 +255,8 @@ def stack_frame_to_function_id(backtrace_location) | |||
is_expected.to have(4).items | |||
|
|||
# All but last are unique | |||
(0..-2).each do |i| | |||
3.times do |i| |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@ivoanjo wanted to bring this to your attention. (0..-2).each
never executes.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh wow, thanks for spotting it! The good news is -- this test is only for the old profiler codepath, that is off by default and no customers should be using anymore.
The new profiler has similar specs, but in different files, and doesn't have this bug as far as I can spot it.
(The old profiler, along with this file are going to be deleted in Q4; I've mostly been finishing up a few other features before I come and remove all of this.)
27acf78
to
7c29267
Compare
7c29267
to
fd676ec
Compare
spec/support/platform_helpers.rb
Outdated
RUBY_ENGINE == 'ruby'.freeze | ||
'ruby'.freeze == RUBY_ENGINE |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this is a bug of the https://www.rubydoc.info/github/bbatsov/RuboCop/RuboCop/Cop/Style/YodaCondition cop.
And I believe it happens because it doesn't know that #freeze
is not really a complex method call, and 'ruby'.freeze
is still an immediate value.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For this file, can I suggest adding # frozen_string_literal: true
to the top, and reverting the YodaCondition changes?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sure!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Minor nit.
What does this PR do?
Upgrades Rubocop from 1.34.0 to 1.50.0
Motivation:
While working on another branch, I encountered a bug where attempting to disable
Lint/MissingSuper
led to aLint/RedundantCopDisableDirective
error that could not be suppressed.Additional Notes:
Uncovered a test in
profiling/integration_spec.rb
that may have been running as expected.How to test the change?
bundle exec rake rubocop
For Datadog employees:
credentials of any kind, I've requested a review from
@DataDog/security-design-and-guidance
.Unsure? Have a question? Request a review!